﻿#region Using

using System.Collections.Generic;

using DotNetMatrix;

#endregion

namespace EigenFaces {
	internal class ClassReduceStrategyFurthestFromCenter : IClassReduceStrategy {
		public void Reduce(List<Matrix> list, DotNetMatrix.Matrix trait) {
			var center = list.GetAverage();
			var distance = double.MinValue;
			var pos = 0;
			for( var i = 0; i < list.Count; i++ ) {
				var d = list[i].EuclidDistance(center);
				if( d > distance ) {
					distance = d;
					pos = i;
				}
			}
			list.RemoveAt(pos);
		}

		override public string ToString() {
			return "Entferntestes vom Durchschnitt";
		}
	}
}
